home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / INTERRUP.SWG / 0014_Interrupt Jumping.pas < prev    next >
Pascal/Delphi Source File  |  1994-01-27  |  1KB  |  27 lines

  1. {
  2.  If you have an interrupt handler and you want to jump to the original
  3.  interrupt handler and NOT return to your handler.
  4.  
  5. Call the following procedure with a pointer to the old interrupt handler
  6. (which you'd better have saved :-).
  7. }
  8.  
  9. PROCEDURE JumpToInterrupt(oldvector : Pointer);
  10. INLINE(                        { Jump to old Intr from local ISR  }
  11.    $5B/                        { POP  BX IP part of vector     }
  12.    $58/                        { POP  AX CS part of vector     }
  13.    $87/$5E/$0E/                { XCHG BX,[BP+14] switch ofs/bx }
  14.    $87/$46/$10/                { XCHG AX,[BP+16] switch seg/ax }
  15.    $8B/$E5/                    { MOV  SP,BP                    }
  16.    $5D/                        { POP  BP                       }
  17.    $07/                        { POP  ES                       }
  18.    $1F/                        { POP  DS                       }
  19.    $5F/                        { POP  DI                       }
  20.    $5E/                        { POP  SI                       }
  21.    $5A/                        { POP  DX                       }
  22.    $59/                        { POP  CX                       }
  23.    $CB                         { RETF      Jump [ToOldVector]  }
  24.    );                          { to original timer vector      }
  25. {end JumpToInterrupt}
  26.  
  27.